import { cloneDeep } from 'lodash-es'
import { BwVanComNameEnum } from '../../../render/enums'

import { vanFormOptions } from './src/form'
import { vanFieldOptions } from './src/field'
import { vanRadioGroupOptions } from './src/radioGroup'
import { vanRadioOptions } from './src/radio'
import { vanCheckboxGroupOptions } from './src/checkboxGroup'
import { vanCheckboxOptions } from './src/checkbox'
import { vanPickerOptions } from './src/picker'
import { vanPickerGroupOptions } from './src/pickerGroup'
import { vanSwitchOptions } from './src/switch'
import { vanDateOptions } from './src/date'
import { vanTimeOptions } from './src/time'
import { vanRateOptions } from './src/rate'
import { vanCascaderOptions } from './src/cascader'
import { vanColOptions } from './src/col'
import { vanRowOptions } from './src/row'
import { vanPopupOptions } from './src/popup'
import { vanCellOptions } from './src/cell'
import { vanCellGroupOptions } from './src/cellGroup'

import type { BwDesignNodeComDefaultOptionModel } from '../../model'

/** 获取组件默认配置信息 */
export function getVantComDefaultConfig(comCode: BwVanComNameEnum) {
  const data: BwDesignNodeComDefaultOptionModel = {
    attrs: null,
    enableSlotList: null,
  }
  switch (comCode) {
    case BwVanComNameEnum.VanForm: {
      data.attrs = cloneDeep(vanFormOptions.attrs)
      data.enableSlotList = cloneDeep(vanFormOptions.slotList)
      break
    }
    case BwVanComNameEnum.VanField: {
      data.attrs = cloneDeep(vanFieldOptions.attrs)
      data.enableSlotList = cloneDeep(vanFieldOptions.slotList)
    }
    case BwVanComNameEnum.VanRadioGroup: {
      data.attrs = cloneDeep(vanRadioGroupOptions.attrs)
      data.enableSlotList = cloneDeep(vanRadioGroupOptions.slotList)
      break
    }
    case BwVanComNameEnum.VanRadio: {
      data.attrs = cloneDeep(vanRadioOptions.attrs)
      data.enableSlotList = cloneDeep(vanRadioOptions.slotList)
      break
    }
    case BwVanComNameEnum.VanCheckboxGroup: {
      data.attrs = cloneDeep(vanCheckboxGroupOptions.attrs)
      data.enableSlotList = cloneDeep(vanCheckboxGroupOptions.slotList)
      break
    }
    case BwVanComNameEnum.VanCheckbox: {
      data.attrs = cloneDeep(vanCheckboxOptions.attrs)
      data.enableSlotList = cloneDeep(vanCheckboxOptions.slotList)
      break
    }
    case BwVanComNameEnum.VanPicker: {
      data.attrs = cloneDeep(vanPickerOptions.attrs)
      data.enableSlotList = cloneDeep(vanPickerOptions.slotList)
      break
    }
    case BwVanComNameEnum.VanPickerGroup: {
      data.attrs = cloneDeep(vanPickerGroupOptions.attrs)
      data.enableSlotList = cloneDeep(vanPickerGroupOptions.slotList)
      break
    }
    case BwVanComNameEnum.VanSwitch: {
      data.attrs = cloneDeep(vanSwitchOptions.attrs)
      data.enableSlotList = cloneDeep(vanSwitchOptions.slotList)
      break
    }
    case BwVanComNameEnum.VanDatePicker: {
      data.attrs = cloneDeep(vanDateOptions.attrs)
      data.enableSlotList = cloneDeep(vanDateOptions.slotList)
      break
    }
    case BwVanComNameEnum.VanTimePicker: {
      data.attrs = cloneDeep(vanTimeOptions.attrs)
      data.enableSlotList = cloneDeep(vanTimeOptions.slotList)
      break
    }
    case BwVanComNameEnum.VanRate: {
      data.attrs = cloneDeep(vanRateOptions.attrs)
      data.enableSlotList = cloneDeep(vanRateOptions.slotList)
      break
    }
    case BwVanComNameEnum.VanCascader: {
      data.attrs = cloneDeep(vanCascaderOptions.attrs)
      data.enableSlotList = cloneDeep(vanCascaderOptions.slotList)
      break
    }
    case BwVanComNameEnum.VanCol: {
      data.attrs = cloneDeep(vanColOptions.attrs)
      data.enableSlotList = cloneDeep(vanColOptions.slotList)
      break
    }
    case BwVanComNameEnum.VanRow: {
      data.attrs = cloneDeep(vanRowOptions.attrs)
      data.enableSlotList = cloneDeep(vanRowOptions.slotList)
      break
    }
    case BwVanComNameEnum.VanPopup: {
      data.attrs = cloneDeep(vanPopupOptions.attrs)
      data.enableSlotList = cloneDeep(vanPopupOptions.slotList)
      break
    }
    case BwVanComNameEnum.VanCell: {
      data.attrs = cloneDeep(vanCellOptions.attrs)
      data.enableSlotList = cloneDeep(vanCellOptions.slotList)
      break
    }
    case BwVanComNameEnum.VanCellGroup: {
      data.attrs = cloneDeep(vanCellGroupOptions.attrs)
      data.enableSlotList = cloneDeep(vanCellGroupOptions.slotList)
      break
    }
  }
  return data
}
